package com.holylin.learning.java.jpa;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Date;


/**
 * The persistent class for the user database table.
 * 
 */
@Entity
@Table(name="user")
public class User implements Serializable {
	private static final long serialVersionUID = 1L;
	private Integer id;
	private String lastLoginIP;
	private Date lastLoginTime;
	private String sinaAccessToken;
	private String sinaAccessTokenSecret;
	private short state;
	private String trueName;
	private String userName;
	private String userSource;
	private String weiboUserId;

    public User() {
    }


	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(unique=true, nullable=false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}


	@Column(length=50)
	public String getLastLoginIP() {
		return this.lastLoginIP;
	}

	public void setLastLoginIP(String lastLoginIP) {
		this.lastLoginIP = lastLoginIP;
	}


    @Temporal( TemporalType.TIMESTAMP)
	public Date getLastLoginTime() {
		return this.lastLoginTime;
	}

	public void setLastLoginTime(Date lastLoginTime) {
		this.lastLoginTime = lastLoginTime;
	}


	@Column(length=128)
	public String getSinaAccessToken() {
		return this.sinaAccessToken;
	}

	public void setSinaAccessToken(String sinaAccessToken) {
		this.sinaAccessToken = sinaAccessToken;
	}


	@Column(length=128)
	public String getSinaAccessTokenSecret() {
		return this.sinaAccessTokenSecret;
	}

	public void setSinaAccessTokenSecret(String sinaAccessTokenSecret) {
		this.sinaAccessTokenSecret = sinaAccessTokenSecret;
	}


	@Column(nullable=false)
	public short getState() {
		return this.state;
	}

	public void setState(short state) {
		this.state = state;
	}


	@Column(length=50)
	public String getTrueName() {
		return this.trueName;
	}

	public void setTrueName(String trueName) {
		this.trueName = trueName;
	}


	@Column(nullable=false, length=100)
	public String getUserName() {
		return this.userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}


	@Column(nullable=false, length=20)
	public String getUserSource() {
		return this.userSource;
	}

	public void setUserSource(String userSource) {
		this.userSource = userSource;
	}


	@Column(length=100)
	public String getWeiboUserId() {
		return this.weiboUserId;
	}

	public void setWeiboUserId(String weiboUserId) {
		this.weiboUserId = weiboUserId;
	}

}